﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TAdCustomer.aspx.cs" Inherits="Adcustomer_TAdCustomer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
         table { border-collapse:collapse; border: none; padding: 0; margin: 0; }
    </style>
    <link href="../css/ecrm03.css" rel="stylesheet" type="text/css" />
    <link href="../css/pagebox.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery0905.js" type="text/javascript"></script>
    <script src="../js/jqModal.js" type="text/javascript"></script>  
    <script language="JScript" src="../js/myCheck.js"></script>
    <script type="text/javascript" language="javascript">  
    function NotCharacter(str,name)
    {
        var vstr =/^[A-Za-z0-9]+$/;
        if(!vstr.test(str)){
        alert(name+"必须是字母或数字!");
        return false;}
    }
    function chk() 
	{
	    $('#txt_id').val($.trim( $('#txt_id').val()));
	    $('#txt_name').val($.trim( $('#txt_name').val()));
	    $('#txt_name2').val($.trim( $('#txt_name2').val()));
	    $('#txt_addr').val($.trim( $('#txt_addr').val()));
	    $('#txt_zip').val($.trim( $('#txt_zip').val()));
	    $('#txt_www').val($.trim( $('#txt_www').val()));
	    $('#txt_bankname').val($.trim( $('#txt_bankname').val()));
	    $('#txt_number').val($.trim( $('#txt_number').val()));
	    
	    if(NotCharacter(form1.txt_id.value,"编码")==false) return false;
		if(CheckText(form1.txt_id,"编码",30)==false) return false;
		if(CheckText(form1.txt_name,"姓名",10)==false) return false;
		if(CheckText(form1.txt_name2,"简称",30)==false) return false;
		if(CheckText(form1.txt_addr,"地址",30)==false) return false;
		if(CheckText(form1.txt_zip,"邮编",30)==false) return false;
		if(CheckText(form1.txt_www,"网址",30)==false) return false;
		if(CheckText(form1.txt_bankname,"开户银行",30)==false) return false;
		if(CheckText(form1.txt_number,"帐号",30)==false) return false;
		return true;
	}
	function chk1()
	{
	    $('#txt_uname').val($.trim( $('#txt_uname').val()));
	    $('#txt_uname2').val($.trim( $('#txt_uname2').val()));
	    $('#txt_uaddr').val($.trim( $('#txt_uaddr').val()));
	    $('#txt_uzip').val($.trim( $('#txt_uzip').val()));
	    $('#txt_uwww').val($.trim( $('#txt_uwww').val()));
	    $('#txt_ubankname').val($.trim( $('#txt_ubankname').val()));
	    $('#txt_unumber').val($.trim( $('#txt_unumber').val()));
	    
	    if(CheckText(form1.txt_uname,"姓名",10)==false) return false;
		if(CheckText(form1.txt_uname2,"简称",30)==false) return false;
		if(CheckText(form1.txt_uaddr,"地址",30)==false) return false;
		if(CheckText(form1.txt_uzip,"邮编",30)==false) return false;
		if(CheckText(form1.txt_uwww,"网址",30)==false) return false;
		if(CheckText(form1.txt_ubankname,"开户银行",30)==false) return false;
		if(CheckText(form1.txt_unumber,"帐号",30)==false) return false;
		return true;
	}
    $(function() {
        $("#checkedAll").click(function() { 
            if ($(this).attr("checked") == true) { // 全选
                    $("input[@type='checkbox']").each(function() {
                    $(this).attr("checked", true);
                    });
                } else { // 取消全选
                    $("input[@type='checkbox']").each(function() {
                    $(this).attr("checked", false);
                });
            }
        });
    });
    
    $().ready(function() {
        $('#divInsert').jqm({modal: true,trigger: '#btn_Insert'});
        $('#divUpdate').jqm({modal: true,trigger: '#btn_update'});
//        $('#divDelete').jqm({trigger: '#delete'});
//        $('#divUpload').jqm({trigger: '#upload'});
//        $('#divCopy').jqm({trigger: '#copy'});
//        $('#divPaste').jqm({trigger: '#paste'});
//        $('#divCut').jqm({trigger: '#cut'});
//        $('#divKeyword').jqm({trigger: '#addkeyword'}); 
//        $('#divRemark').jqm({trigger:'#remark'});
    });
    function checkfile()
    {
        var ext=$('#FileUpload1').val().split(".")[$('#FileUpload1').val().split(".").length-1];
        var notstr="bat,com,exe";
        if(notstr.indexOf(ext) !=-1)
        {
            alert("不能上传可执行文件!");
            return false;
        }
        return true;
    }
    function checksel()
    {
        var count=$("input[@type='checkbox']")
    }
        function showdiv()
    {
        $('#divUpdate').jqmShow(); 
    }
    
    function edit(strid)
    {
        var urlstring="TAdCustomer.aspx";
            $.ajax({
            url:urlstring,
            type:'post',
            dataType:'html',
            data:'&opration=edit&id='+ strid ,
            beforeSend:function()
            {
               
            },
            error:function()
            {
               
            },
            success: function(msg)
            {
                var val=msg.split(',');
            
                $('#lbl_id').text(val[0]);
                $('#txt_uname').val(val[1]);
                $('#txt_uname2').val(val[2]);
                $('#txt_uarea').val(val[3]);
                $('#txt_ucgroup').val(val[4]);
                $('#txt_uclevel').val(val[5]);
                $('#txt_uaddr').val(val[6]);   
                $('#txt_uzip').val(val[7]);
                $('#txt_uwww').val(val[8]);
                $('#txt_ubankname').val(val[9]);
                $('#txt_unumber').text(val[10]);
                $('#HiddenField1').val(val[0]);
                $('#divUpdate').jqmShow(); 
            }
            });
    }
    function showdivinsert()
    {
         $('#divInsert').jqmShow();
    }
    
      function   kk(obj)   
      {           
      if(obj.value.length==10)   
      {   
      event.keyCode   =   0;   
      return   ;   
      }   
      } 
function ddlbind()
    {
        var urlstring="TAdCustomer.aspx";
            $.ajax({
            url:urlstring,
            type:'post',
            dataType:'html',
            data:'&opration=ddlbind' ,
            beforeSend:function()
            {
               
            },
            error:function()
            {
               
            },
            success: function(msg)
            {
            }
            });
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">

    <div style="text-align: center">
    <div id="menu">
        <div id="divInsert" class="jqmWindow" style="display:none; left: 72%; top: 16%; width: 231px; height: 326px;">
       <table width='100%' style ="background-color:#0075b0">
            <tr>
                 <td align="left" id='tdtitle' style="font-size:12px;color:White">增加</td>
                <td align="right" ><asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/adsales/images/close.png"
                    OnClick="ImageButton2_Click" /></td>
            </tr>
       </table>
       
       <table style="width: 210px">
            <tr>
                <td style="width: 128px; text-align: right">编码：</td>
                <td colspan="2" style="text-align: left">
                    <asp:TextBox ID="txt_id" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right">
                    全称：</td>
                <td colspan="2" style="text-align: left">
                    <asp:TextBox ID="txt_name" runat="server" MaxLength="10"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right">
                    简称：</td>
                <td style="text-align: left" colspan="2">
                    <asp:TextBox ID="txt_name2" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 128px; text-align: right; height: 24px;">
                    区域：</td>
                <td colspan="2" style="height: 24px; text-align: left">
                    <asp:DropDownList ID="ddl_area" runat="server" Width="100px">
                    </asp:DropDownList></td>
            </tr>
           <tr>
               <td style="width: 128px; text-align: right">
                    分组：</td>
               <td colspan="2" rowspan="1" style="text-align: left">
                   <asp:DropDownList ID="ddl_cgroup" runat="server" Width="100px">
                   </asp:DropDownList></td>
           </tr>
           <tr>
               <td style="width: 128px; text-align: right">
                   级别：</td>
               <td colspan="2" rowspan="1" style="text-align: left">
                   <asp:DropDownList ID="ddl_clevel" runat="server" Width="100px">
                   </asp:DropDownList></td>
           </tr>
            <tr>
                <td style="width: 128px; text-align: right">
                    地址：</td>
                <td style="text-align: left" colspan="2">
                    <asp:TextBox ID="txt_addr" runat="server"></asp:TextBox><%--<asp:RadioButton ID="rbtn_yes" runat="server" Checked="True" GroupName="2" Text="有效" />
                    <asp:RadioButton ID="rbtn_no" runat="server" GroupName="2" Text="失效" />--%></td>
            </tr>
           <tr>
               <td style="width: 128px; text-align: right">
                   邮编：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_zip" runat="server"></asp:TextBox></td>
           </tr>
           <tr>
               <td style="width: 128px; text-align: right">
                   网址：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_www" runat="server"></asp:TextBox></td>
           </tr>
           <tr>
               <td style="width: 128px; text-align: right">
                   开户银行：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_bankname" runat="server"></asp:TextBox></td>
           </tr>
           <tr>
               <td style="width: 128px; text-align: right">
                   帐号：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_number" runat="server"></asp:TextBox></td>
           </tr>
            <tr>
                <td colspan="3">
                    <asp:Button ID="btn_insert" runat="server" Text="确定" OnClick="btn_insert_Click"  Width="50px" OnClientClick="return chk()" style="color: #ffffff; background-color: #296cb3" Height="20px"  /></td>
            </tr>
       </table>
       </div>
       
         <div id="divUpdate" class="jqmWindow" style="display:none; left: 72%; top: 16%; width: 228px; height: 303px;">
       <table width='100%' style ="background-color:#0075b0">
            <tr>
                 <td align="left" id='td1' style="font-size:12px;color:White">修改</td>
                <td align="right" ><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/adsales/images/close.png"
                    OnClick="ImageButton2_Click" /></td>
            </tr>
       </table>
       
       <table style="width: 208px; height: 277px">
            <tr>
                <td style="width: 93px; text-align: right">编码：</td>
                <td colspan="2" style="text-align: left">
                    <asp:Label ID="lbl_id" runat="server" Text="Label"></asp:Label></td>
            </tr>
            <tr>
                <td style="width: 93px; text-align: right">
                    全称：</td>
                <td colspan="2" style="text-align: left">
                    <asp:TextBox ID="txt_uname" runat="server" MaxLength="10"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 93px; text-align: right">
                    简称：</td>
                <td style="text-align: left" colspan="2">
                    <asp:TextBox ID="txt_uname2" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 93px; text-align: right; height: 24px;">
                    区域：</td>
                <td colspan="2" style="height: 24px; text-align: left">
                    <asp:DropDownList ID="ddl_uarea" runat="server" Width="100px">
                    </asp:DropDownList></td>
            </tr>
           <tr>
               <td style="width: 93px; text-align: right">
                    分组：</td>
               <td colspan="2" rowspan="1" style="text-align: left">
                   <asp:DropDownList ID="ddl_ucgroup" runat="server" Width="100px">
                   </asp:DropDownList></td>
           </tr>
           <tr>
               <td style="width: 93px; text-align: right">
                   级别：</td>
               <td colspan="2" rowspan="1" style="text-align: left">
                   <asp:DropDownList ID="ddl_uclevel" runat="server" Width="100px">
                   </asp:DropDownList></td>
           </tr>
            <tr>
                <td style="width: 93px; text-align: right">
                    地址：</td>
                <td style="text-align: left" colspan="2">
                    <asp:TextBox ID="txt_uaddr" runat="server"></asp:TextBox><%--<asp:RadioButton ID="rbtn_yes" runat="server" Checked="True" GroupName="2" Text="有效" />
                    <asp:RadioButton ID="rbtn_no" runat="server" GroupName="2" Text="失效" />--%></td>
            </tr>
           <tr>
               <td style="width: 93px; text-align: right">
                   邮编：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_uzip" runat="server"></asp:TextBox></td>
           </tr>
           <tr>
               <td style="width: 93px; text-align: right">
                   网址：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_uwww" runat="server"></asp:TextBox></td>
           </tr>
           <tr>
               <td style="width: 93px; text-align: right">
                   开户银行：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_ubankname" runat="server"></asp:TextBox></td>
           </tr>
           <tr>
               <td style="width: 93px; text-align: right">
                   帐号：</td>
               <td style="text-align: left" colspan="2">
                   <asp:TextBox ID="txt_unumber" runat="server"></asp:TextBox></td>
           </tr>
            <tr>
                <td colspan="3">
                    &nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="修改" Width="50px" OnClientClick="return chk1()" style="color: #ffffff; background-color: #296cb3" Height="20px"  />
               </td>
            </tr>
       </table>
             <asp:HiddenField ID="HiddenField1" runat="server" />
       </div>
       
       
       
   </div>
        
        <table cellSpacing="0" cellPadding="0" border="0" align="center">
		    <tr>
		        <td style="background-color:White;padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px;">
		            <table cellSpacing="0" cellPadding="0" width="600" align="center" border="0" style="background-color:White;">
		                <tr>
		                    <td style="BORDER-RIGHT: #90b0de 1px solid; BORDER-TOP: #90b0de 1px solid; BORDER-LEFT: #90b0de 1px solid; BORDER-BOTTOM: #90b0de 1px solid; height: 213px; text-align: center;">
        
        <table border="0" width=900 align="center">
            <tr>
                <td style="border-top-width: 1px; font-weight: bold; border-left-width: 1px; border-left-color: #90b0de;
                    color: #004499; border-top-color: #90b0de; border-bottom: #90b0de 1px solid;
                    background-color: #ecf5ff; border-right-width: 1px; border-right-color: #90b0de; height: 29px; text-align: center;">
                    aaa</td>
            </tr>
               </table>
               <br />
        <table style="width:800px">
            <tr>
                <td colspan="6" style="background-color: #ecf5ff">
                用户查找
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    编码：</td>
                <td style="width: 100px">
                    <asp:TextBox ID="txt_SelectId" runat="server"></asp:TextBox></td>
                <td style="width: 100px">
                    全称：</td>
                <td style="width: 100px">
                    <asp:TextBox ID="txt_SelectName" runat="server"></asp:TextBox></td>
                <td style="width: 100px">
                    <asp:Button ID="btn_look" runat="server" Text="查找" style="color: #ffffff; background-color: #296cb3" Height="20px" Width="50px" OnClick="btn_look_Click" /></td>
                <td style="width: 100px">
                    <asp:Button ID="Button3" runat="server" Text="全部显示" style="color: #ffffff; background-color: #296cb3" Height="20px" Width="80px" OnClick="Button3_Click" /></td>
            </tr>
            <tr>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
                <td style="width: 100px">
                </td>
            </tr>
        </table>
        <asp:Repeater  ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand"  >
            <HeaderTemplate>
                <table style="font-size:13px" border="0" width="800" align="center">
                <tr>
                    <td align="center" colspan=12 style=" width:100%; background-color: #ecf5ff">用户信息表</td>
                </tr>
                <tr > 
                    <td colspan=12 align="left" style="width:100%"><%--<a id="Insert"
                    href="javascript:void(0);"><span style="color: #0000ff; text-decoration: underline">
                        <img title="增加" alt="增加" src="../webdisk/images/ico/folder_new.gif" /></span></a>--%>
                        <input type="button" id='btn_Insert' value='增加' onclick="ddlbind();" style=' height:"20"; width:50; border-right-style: none; background-color: #296cb3; color: #ffffff; border-left-style: none;'/>
                        <%--<asp:button Width='40' id="btnAdd" runat="server"  Text="刷新" CausesValidation="false" BackColor="#296CB3" BorderStyle="None" ForeColor="White" ></asp:button>--%>
                        
                        <br /></td>
                       
                </tr>
                <tr style="background-color:#ecf5ff">
                    <td style="width:72; text-align:center">编号</td>
                    <td style="width:72; text-align:center">全称</td>
                    <td style="width:72; text-align:center">简称</td>
                    <td style="width:72; text-align:center">区域</td>
                    <td style="width:72; text-align:center">分组</td>
                    <td style="width:72; text-align:center">级别</td>

                    <td style="width:72; text-align:center">网址</td>
                    <td style="width:72; text-align:center">开户银行</td>
                    <td style="width:80; text-align:center">账号</td>

                    <td style="width:72; text-align:center">查看</td>
                    <td style="width:72; text-align:center">选择</td>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td style="width:72; text-align:center">
                        <a href='javascript:void(0);' onclick ='javascript:edit("<%#Eval("customer_id") %>")'><%#Eval("customer_id") %></a>
                    </td>
                    <td style="width:72; text-align:center">
                        <%#Eval("name")%>
                    </td>
                    <td style="width:72; text-align:center">
                        <%#Eval("name2")%>
                    </td>
                    <td style="width:72; text-align:center">
                        <%#Eval("area")%>
                    </td>
                    
                    <td style="width:72; text-align:center">
                        <%#Eval("cgroup")%>
                    </td>
                    <td style="width:72; text-align:center"><%#Eval("clevel")%>
                        
                    </td>

                    <td style="width:72; text-align:center"><%#Eval("www")%></td>
                    <td style="width:72; text-align:center"><%#Eval("bankname")%></td>
                    <td style="width:80; text-align:center"><%#Eval("account")%></td>
                    <td style="width:72; text-align:center"><a href='TAdCustomerLinkman.aspx?customer_id=<%#Eval("customer_id") %>'>下一级</a></td>
                    <td style="width:72; text-align:center">
                    <asp:linkbutton id="lbDelete" runat="server" CommandName="Del" CommandArgument='<%#Eval("customer_id") %>'><img border="0" src="./images/del.gif" alt="删除" onClick="javascript:{return confirm('删除操作不可恢复，确认吗？');}"></asp:linkbutton>
                        <%--<asp:Button ID="Button1" runat="server" Text="删除" CommandName="Del" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        <%--<asp:Button ID="btn_update" runat="server" Text="修改" OnClientClick="$('#divUpdate').jqmShow();" CommandName="update" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        
                    </td>
                    
                </tr>
            </ItemTemplate>
             <AlternatingItemTemplate>
                <tr bgcolor="#ecf5ff">
                    <td style="width:72; text-align:center">
                        <a href='javascript:void(0);' onclick ='javascript:edit("<%#Eval("customer_id") %>")'><%#Eval("customer_id") %></a>
                    </td>
                    <td style="width:72; text-align:center">
                        <%#Eval("name")%>
                    </td>
                    <td style="width:72; text-align:center">
                        <%#Eval("name2")%>
                    </td>
                    <td style="width:72; text-align:center">
                        <%#Eval("area")%>
                    </td>
                    
                    <td style="width:72; text-align:center">
                        <%#Eval("cgroup")%>
                    </td>
                    <td style="width:72; text-align:center">
                        <%#Eval("clevel")%>
                    </td>

                    <td style="width:72; text-align:center"><%#Eval("www")%></td>
                    <td style="width:72; text-align:center"><%#Eval("bankname")%></td>
                    <td style="width:80; text-align:center"><%#Eval("account")%></td>
                    <td style="width:72; text-align:center"><a href='TAdCustomerLinkman.aspx?customer_id=<%#Eval("customer_id") %>'>下一级</a></td>
                    <td style="width:72; text-align:center">
                    <asp:linkbutton id="lbDelete" runat="server" CommandName="Del" CommandArgument='<%#Eval("customer_id") %>'><img border="0" src="./images/del.gif" alt="删除" onClick="javascript:{return confirm('删除操作不可恢复，确认吗？');}"></asp:linkbutton>
                        <%--<asp:Button ID="Button1" runat="server" Text="删除" CommandName="Del" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        <%--<asp:Button ID="btn_update" runat="server" Text="修改" OnClientClick="$('#divUpdate').jqmShow();" CommandName="update" CommandArgument='<%#Eval("SalesCode") %>' />--%>
                        
                    </td>
                </tr>

             </AlternatingItemTemplate>
             

            <FooterTemplate>
                    <tr>
                        <td colspan=9 style="width=100%"><%=pager%></td>
                    </tr>
                </table>
            </FooterTemplate>
        </asp:Repeater>
<br />
</td>
		                </tr>
		            </table>
		        </td>
		    </tr>
		</table>
    
    </form>
</body>
</html>
